<template>
<div>
    <Tree :data="data1" :load-data="loadData" :render="renderContent"></Tree>
    <Modal
        v-model="modal1"
        title="Common Modal dialog box title" cancel-text='AAA'
        >
        <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
        <FormItem label="Text" prop="text">
            <Input v-model="formValidate.text" placeholder="Enter your text"></Input>
        </FormItem>
        <FormItem label="content" prop="content">
            <Input v-model="formValidate.content" placeholder="Enter your content"></Input>
        </FormItem>
        <FormItem>
            <Button type="primary" @click="handleSubmit('formValidate')">Submit</Button>
            <Button @click="handleReset('formValidate')" style="margin-left: 8px">Reset</Button>
        </FormItem>
    </Form>
    </Modal>
    </div>
</template>
<script>
   import {Base} from '@/components/base/base2';
    export default {
        mixins:[Base],
        data () {
            return {
                data1: [
                    {
                        title:'新闻管理',
                        loading: false,
                        children: [],
                        type:3,
                        render: (h, { root, node, data }) => {
                            return h('span', {
                                style: {
                                    display: 'inline-block',
                                    width: '100%',
                                    height:'30px'
                                }
                            },[
                                h('span', [
                                    
                                    h('span', data.title)
                                ]),
                                h('span', {
                                    style: {
                                        display: 'inline-block',
                                        float: 'right',
                                        marginRight: '32px'
                                    }
                                }, [
                                    h('Button', {
                                        props: Object.assign({}, this.buttonProps, {
                                            icon: 'ios-add',
                                            type: 'primary'
                                        }),
                                        style: {
                                            width: '64px'
                                        },
                                        on: {
                                            click: () => { this.append(root,node,data) }
                                        }
                                    })
                                ])
                            ])
                        }
                    }
                ]
            }
        },
        
    }
</script>